<?php

Yii::import('zii.widgets.CPortlet');
Yii::import('application.modules.product.models.ProductCategories');
Yii::import('application.modules.news.models.NewsCategories');
Yii::import('application.modules.file.models.FileCategories');
Yii::import('application.modules.services.models.ServiceCategories');
Yii::import('application.modules.about.models.About');

class Navbar extends CPortlet {

    public function getNews() {
        $criteria = new CDbCriteria;
        $criteria->addSearchCondition('rank', NewsCategories::MENU);
        return NewsCategories::model()->findAll($criteria);
    }

    public function getFile() {
        $criteria = new CDbCriteria;
        $criteria->addSearchCondition('rank', FileCategories::MENU);
        return FileCategories::model()->findAll($criteria);
    }

    public function getAbout() {
        $criteria = new CDbCriteria;
        $criteria->compare('status', 1);
        return About::model()->findAll($criteria);
    }



    protected function renderContent() {
        $this->render('navbar');
    }

}

?>